<?php
// +----------------------------------------------------------------------
// | 网站配置管理页
// +----------------------------------------------------------------------
// | Copyright (c) 2015
// +----------------------------------------------------------------------
// | Author: baiping 125618036@qq.com http://www.webipcode.com
// +----------------------------------------------------------------------
// | 2015-6-26上午11:13:48
// +----------------------------------------------------------------------
?>
<?php $this->load->view('public/header');?>
<?php $this->load->view('public/head');?>
<div class="container-fluid">
	<div class="row">
		<?php $this->load->view('public/sideleft');?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
			<!-- 内容区 -->
			<div class="main-title">
				<h3>
					配置管理 [ 
					<a href="<?php echo site_url('config/index')?>">全部</a> 
					<a href="<?php echo site_url('config/index?type=1')?>">基本</a> 
					<a href="<?php echo site_url('config/index?type=2')?>">内容</a> 
					<a href="<?php echo site_url('config/index?type=3')?>">用户</a> 
					<a href="<?php echo site_url('config/index?type=4')?>">系统</a>]
				</h3>
			</div>
			<div class="con">
				<div class="cf">
					<div class="pull-left">
						<a href="<?php echo site_url('config/create')?>" class="btn btn-primary">新增</a> 
						<a href="<?php echo site_url('config/changestats/m_delete')?>" class="btn btn-danger ajax-post confirm" target-form="ids">删除</a>
					</div>
					<div class="pull-right search-form">
					<form action="<?php echo site_url('config/index')?>" method="post" name="search_form">
						<input class="search-input" type="text" placeholder="请输入资讯标题或者ID" name="search_name"> 
						<button type="submit" name="sub" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
					</form>	
					</div>
				</div>
				<div class="clearfix"></div>
				<!-- 内容列表 -->
				<?php if ( $record_count > 0 ){?>
				<table class="table table-striped table-hover ">
					<thead>
						<tr>
							<th class="row-selected"><input class="checkbox check-all" type="checkbox"></th>
							<th>ID</th>
							<th>名称</th>
							<th>标题</th>
							<th>分组</th>
							<th>类型</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php foreach($list as $key => $val){?>
					<tr>
						<td><input class="ids row-selected" type="checkbox" value="<?php echo $val->id; ?>" name="id[]"></td>
						<td><?php echo $val->id;?></td>
						<td><small><?php echo $val->name;?></small></td>
						<td><small><?php echo $val->title;?></small></td>
						<td>
						<?php
							if ( $val->group > 0 ){
								echo $group_type['group'][$val->group];
							}else{
								echo '--';	
							}	
						?>
						</td>
						<td>
							<?php echo $group_type['type'][$val->type];?>
						</td>
						<td>
							<a href="<?php echo site_url('config/modfiy/'.$val->id);?>">修改</a>
							<a href="<?php echo site_url('config/changestats/m_delete/'.$val->id);?>" class="confirm ajax-get">删除</a>
						</td>
					</tr>
					<?php }?>
					<?php if( !empty( $pages ) ){?>
					<tr>
						<td colspan="7">
							<ul class="pagination">
								<?php echo $pages;?>
								<li><span>共<?php echo $record_count?>条记录</span></li>
							</ul>
						</td>
					</tr>
					<?php }?>
				</table>
				<?php }else{?>
				<div class="alert alert-warning" role="alert">哦亲！暂无数据</div>
				<?php }?>	
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//左侧菜单高亮显示
highlight_subnav( '<?php echo site_url('config/index')?>' );
</script>
<?php $this->load->view('public/footer');?>